package com.service.merchant.key;

public class MerchantKey
{
	protected int sourceId;
	protected int merchantId;
	protected int attributeId;

	public int getSourceId()
	{
		return sourceId;
	}
	
	public void setSourceId(int sourceId) 
	{
		this.sourceId = sourceId;
	}
	
	public int getMerchantId() 
	{
		return merchantId ;
	}
	
	public void setMerchantId(int merchantId) 
	{
		this.merchantId = merchantId;
	}
	
	public int getAttributeId() 
	{
		return attributeId ;
	}
	
	public void setAttributeId(int attributeId) 
	{
		this.attributeId = attributeId;
	}
	
	@Override
    public int hashCode() 
	{
		String key = sourceId + "_" + merchantId + "_" + attributeId;
		
		return key.hashCode();
	}
	
	@Override
	public boolean equals(Object obj)
    {
		MerchantKey key = (MerchantKey)obj;
		
		if(key.getSourceId() == sourceId && key.getMerchantId() == merchantId && key.getAttributeId() == attributeId)
            return true;
		else
			return false;
    }
}
